import { createSlice } from "@reduxjs/toolkit";


let slice=createSlice({
  name:'zan',
  initialState:{value:0},
  reducers:{
    add:(state,action)=>{
      state.value+=action.payload
    },
    sub:(state,action)=>{
      state.value-=action.payload
    }
  }
})

let reducer=slice.reducer

export let {add,sub}=slice.actions

export default reducer

